package com.tca.spring.framework.learning.ioc;

import com.tca.spring.framework.learning.ioc.circulardependency.A;
import com.tca.spring.framework.learning.ioc.circulardependency.B;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author zhouan
 * @Date 2021/1/21
 */
@Slf4j
public class Start {

    public static void main(String[] args) {
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("spring-context.xml");
//        circularDependency(applicationContext);
    }

    private static void circularDependency(ApplicationContext applicationContext) {
        A a = applicationContext.getBean(A.class);
        B b = applicationContext.getBean(B.class);
        System.out.println(a);
        System.out.println(b);
    }

}
